<template>
  <div class="orderTitle">
    <el-icon size="20" color="#faa019" style="margin-right: 10px"><WarningFilled /></el-icon>
    订单是否完成支付？支付成功后需要1分钟左右时间生效，请耐心等待~
  </div>
  <div class="orderCon">
    <el-button type="success" @click="confirmPayment">确认支付</el-button>
    <el-button @click="cancel">取消</el-button>
  </div>
</template>

<script setup lang="ts">
import { WarningFilled } from '@element-plus/icons-vue'
import { getOrder } from '@/api/Profile/system'

const emit = defineEmits(['handleClose', 'refreshParentData'])

const payStatus = [
  { status: 0, name: '未支付' },
  { status: 10, name: '支付成功' },
  { status: 20, name: '已退款' },
  { status: 30, name: '支付关闭' }
]

const confirmPayment = async () => {
  const { status } = await getOrder(sessionStorage.getItem('ORDERID'))
  emit('refreshParentData')
  if (status == 10) {
  } else {
    emit('handleClose')
  }
}
const cancel = () => {
  emit('handleClose')
}
</script>

<style lang="scss" scoped>
.orderTitle {
  display: flex;
  justify-content: center;
  font-size: 16px;
  font-weight: bold;
  opacity: 0.9;
  align-items: center;
  padding: 10px;
}
.orderCon {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 20px 10px;
}
</style>
@/api/Profile/account
